﻿/*
 * EmeCoder v1.2.1.168
 * 作者：Administrator/JOC-PC
 * 时间：2013-12-16 16:31:20
 * 版权：版权所有 (C) Eme Development Team 2013
*/

﻿using System;
using System.ComponentModel;
using HmFramework.Data;
using HmFramework.Data.Configuration;
using HmFramework.Data.DataAccessLayer;

namespace CuteSprite.Eme.Data.Settlement
{
	/// <summary>计费价格明细</summary>
	[Serializable]
	[DataObject]
	[Description("计费价格明细")]
	[BindIndex("IX_BillingPriceDetail_Weight", true, "BillingPriceID,Weight")]
	[BindIndex("PK__BillingPriceDetailID__D393F569C23DF8B9", true, "ID")]
	[BindRelation("BillingPriceID", false, "BillingPrice", "ID")]
	[BindTable("BillingPriceDetail", Description = "计费价格明细", ConnName = "EmeSettlement", DbType = DatabaseType.SqlServer)]
	public abstract partial class BillingPriceDetail<TEntity> : IBillingPriceDetail
	{
		#region 属性

		private Int32 _ID;

		/// <summary>主键</summary>
		[DisplayName("主键")]
		[Description("主键")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "主键", null, "int", 10, 0, false)]
		public virtual Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } }
		}

		private Int32 _BillingPriceID;

		/// <summary>计费价格</summary>
		[DisplayName("计费价格")]
		[Description("计费价格")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "BillingPriceID", "计费价格", null, "int", 10, 0, false)]
		public virtual Int32 BillingPriceID
		{
			get { return _BillingPriceID; }
			set { if (OnPropertyChanging(__.BillingPriceID, value)) { _BillingPriceID = value; OnPropertyChanged(__.BillingPriceID); } }
		}

		private Decimal _Weight;

		/// <summary>重量</summary>
		[DisplayName("重量")]
		[Description("重量")]
		[DataObjectField(false, false, false, 19)]
		[BindColumn(3, "Weight", "重量", null, "money", 19, 4, false)]
		public virtual Decimal Weight
		{
			get { return _Weight; }
			set { if (OnPropertyChanging(__.Weight, value)) { _Weight = value; OnPropertyChanged(__.Weight); } }
		}

		private Decimal _Price;

		/// <summary>价格</summary>
		[DisplayName("价格")]
		[Description("价格")]
		[DataObjectField(false, false, false, 19)]
		[BindColumn(4, "Price", "价格", null, "money", 19, 4, false)]
		public virtual Decimal Price
		{
			get { return _Price; }
			set { if (OnPropertyChanging(__.Price, value)) { _Price = value; OnPropertyChanged(__.Price); } }
		}

		private SByte _CustomerDiscount;

		/// <summary>客户折扣</summary>
		[DisplayName("客户折扣")]
		[Description("客户折扣")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(5, "CustomerDiscount", "客户折扣", null, "tinyint", 3, 0, false)]
		public virtual SByte CustomerDiscount
		{
			get { return _CustomerDiscount; }
			set { if (OnPropertyChanging(__.CustomerDiscount, value)) { _CustomerDiscount = value; OnPropertyChanged(__.CustomerDiscount); } }
		}

		private SByte _DepartmentDiscount;

		/// <summary>部门折扣</summary>
		[DisplayName("部门折扣")]
		[Description("部门折扣")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(6, "DepartmentDiscount", "部门折扣", null, "tinyint", 3, 0, false)]
		public virtual SByte DepartmentDiscount
		{
			get { return _DepartmentDiscount; }
			set { if (OnPropertyChanging(__.DepartmentDiscount, value)) { _DepartmentDiscount = value; OnPropertyChanged(__.DepartmentDiscount); } }
		}

		private SByte _CompanyDiscount;

		/// <summary>公司折扣</summary>
		[DisplayName("公司折扣")]
		[Description("公司折扣")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(7, "CompanyDiscount", "公司折扣", null, "tinyint", 3, 0, false)]
		public virtual SByte CompanyDiscount
		{
			get { return _CompanyDiscount; }
			set { if (OnPropertyChanging(__.CompanyDiscount, value)) { _CompanyDiscount = value; OnPropertyChanged(__.CompanyDiscount); } }
		}

		private DateTime _ModifiedOn;

		/// <summary>修改时间</summary>
		[DisplayName("修改时间")]
		[Description("修改时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(8, "ModifiedOn", "修改时间", null, "datetime", 3, 0, false)]
		public virtual DateTime ModifiedOn
		{
			get { return _ModifiedOn; }
			set { if (OnPropertyChanging(__.ModifiedOn, value)) { _ModifiedOn = value; OnPropertyChanged(__.ModifiedOn); } }
		}

		private Int32 _ModifiedUserID;

		/// <summary>修改用户ID</summary>
		[DisplayName("修改用户ID")]
		[Description("修改用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(9, "ModifiedUserID", "修改用户ID", null, "int", 10, 0, false)]
		public virtual Int32 ModifiedUserID
		{
			get { return _ModifiedUserID; }
			set { if (OnPropertyChanging(__.ModifiedUserID, value)) { _ModifiedUserID = value; OnPropertyChanged(__.ModifiedUserID); } }
		}

		private String _ModifiedBy;

		/// <summary>修改用户</summary>
		[DisplayName("修改用户")]
		[Description("修改用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(10, "ModifiedBy", "修改用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String ModifiedBy
		{
			get { return _ModifiedBy; }
			set { if (OnPropertyChanging(__.ModifiedBy, value)) { _ModifiedBy = value; OnPropertyChanged(__.ModifiedBy); } }
		}

		private DateTime _CreateOn;

		/// <summary>创建时间</summary>
		[DisplayName("创建时间")]
		[Description("创建时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(11, "CreateOn", "创建时间", null, "datetime", 3, 0, false)]
		public virtual DateTime CreateOn
		{
			get { return _CreateOn; }
			set { if (OnPropertyChanging(__.CreateOn, value)) { _CreateOn = value; OnPropertyChanged(__.CreateOn); } }
		}

		private Int32 _CreateUserID;

		/// <summary>创建用户ID</summary>
		[DisplayName("创建用户ID")]
		[Description("创建用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(12, "CreateUserID", "创建用户ID", null, "int", 10, 0, false)]
		public virtual Int32 CreateUserID
		{
			get { return _CreateUserID; }
			set { if (OnPropertyChanging(__.CreateUserID, value)) { _CreateUserID = value; OnPropertyChanged(__.CreateUserID); } }
		}

		private String _CreateBy;

		/// <summary>创建用户</summary>
		[DisplayName("创建用户")]
		[Description("创建用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(13, "CreateBy", "创建用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String CreateBy
		{
			get { return _CreateBy; }
			set { if (OnPropertyChanging(__.CreateBy, value)) { _CreateBy = value; OnPropertyChanged(__.CreateBy); } }
		}

		#endregion 属性

		#region 获取/设置 字段值

		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case __.ID: return _ID;
					case __.BillingPriceID: return _BillingPriceID;
					case __.Weight: return _Weight;
					case __.Price: return _Price;
					case __.CustomerDiscount: return _CustomerDiscount;
					case __.DepartmentDiscount: return _DepartmentDiscount;
					case __.CompanyDiscount: return _CompanyDiscount;
					case __.ModifiedOn: return _ModifiedOn;
					case __.ModifiedUserID: return _ModifiedUserID;
					case __.ModifiedBy: return _ModifiedBy;
					case __.CreateOn: return _CreateOn;
					case __.CreateUserID: return _CreateUserID;
					case __.CreateBy: return _CreateBy;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case __.ID: _ID = Convert.ToInt32(value); break;
					case __.BillingPriceID: _BillingPriceID = Convert.ToInt32(value); break;
					case __.Weight: _Weight = Convert.ToDecimal(value); break;
					case __.Price: _Price = Convert.ToDecimal(value); break;
					case __.CustomerDiscount: _CustomerDiscount = Convert.ToSByte(value); break;
					case __.DepartmentDiscount: _DepartmentDiscount = Convert.ToSByte(value); break;
					case __.CompanyDiscount: _CompanyDiscount = Convert.ToSByte(value); break;
					case __.ModifiedOn: _ModifiedOn = Convert.ToDateTime(value); break;
					case __.ModifiedUserID: _ModifiedUserID = Convert.ToInt32(value); break;
					case __.ModifiedBy: _ModifiedBy = Convert.ToString(value); break;
					case __.CreateOn: _CreateOn = Convert.ToDateTime(value); break;
					case __.CreateUserID: _CreateUserID = Convert.ToInt32(value); break;
					case __.CreateBy: _CreateBy = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}

		#endregion 获取/设置 字段值

		#region 字段名

		/// <summary>取得计费价格明细字段信息的快捷方式</summary>
		public partial class _
		{
			///<summary>主键</summary>
			public static readonly Field ID = FindByName(__.ID);

			///<summary>计费价格</summary>
			public static readonly Field BillingPriceID = FindByName(__.BillingPriceID);

			///<summary>重量</summary>
			public static readonly Field Weight = FindByName(__.Weight);

			///<summary>价格</summary>
			public static readonly Field Price = FindByName(__.Price);

			///<summary>客户折扣</summary>
			public static readonly Field CustomerDiscount = FindByName(__.CustomerDiscount);

			///<summary>部门折扣</summary>
			public static readonly Field DepartmentDiscount = FindByName(__.DepartmentDiscount);

			///<summary>公司折扣</summary>
			public static readonly Field CompanyDiscount = FindByName(__.CompanyDiscount);

			///<summary>修改时间</summary>
			public static readonly Field ModifiedOn = FindByName(__.ModifiedOn);

			///<summary>修改用户ID</summary>
			public static readonly Field ModifiedUserID = FindByName(__.ModifiedUserID);

			///<summary>修改用户</summary>
			public static readonly Field ModifiedBy = FindByName(__.ModifiedBy);

			///<summary>创建时间</summary>
			public static readonly Field CreateOn = FindByName(__.CreateOn);

			///<summary>创建用户ID</summary>
			public static readonly Field CreateUserID = FindByName(__.CreateUserID);

			///<summary>创建用户</summary>
			public static readonly Field CreateBy = FindByName(__.CreateBy);

			private static Field FindByName(String name)
			{
				return Meta.Table.FindByName(name);
			}
		}

		/// <summary>取得计费价格明细字段名称的快捷方式</summary>
		public partial class __
		{
			///<summary>主键</summary>
			public const String ID = "ID";

			///<summary>计费价格</summary>
			public const String BillingPriceID = "BillingPriceID";

			///<summary>重量</summary>
			public const String Weight = "Weight";

			///<summary>价格</summary>
			public const String Price = "Price";

			///<summary>客户折扣</summary>
			public const String CustomerDiscount = "CustomerDiscount";

			///<summary>部门折扣</summary>
			public const String DepartmentDiscount = "DepartmentDiscount";

			///<summary>公司折扣</summary>
			public const String CompanyDiscount = "CompanyDiscount";

			///<summary>修改时间</summary>
			public const String ModifiedOn = "ModifiedOn";

			///<summary>修改用户ID</summary>
			public const String ModifiedUserID = "ModifiedUserID";

			///<summary>修改用户</summary>
			public const String ModifiedBy = "ModifiedBy";

			///<summary>创建时间</summary>
			public const String CreateOn = "CreateOn";

			///<summary>创建用户ID</summary>
			public const String CreateUserID = "CreateUserID";

			///<summary>创建用户</summary>
			public const String CreateBy = "CreateBy";
		}

		#endregion 字段名
	}

	/// <summary>计费价格明细接口</summary>
	public partial interface IBillingPriceDetail
	{
		#region 属性

		/// <summary>主键</summary>
		Int32 ID { get; set; }

		/// <summary>计费价格</summary>
		Int32 BillingPriceID { get; set; }

		/// <summary>重量</summary>
		Decimal Weight { get; set; }

		/// <summary>价格</summary>
		Decimal Price { get; set; }

		/// <summary>客户折扣</summary>
		SByte CustomerDiscount { get; set; }

		/// <summary>部门折扣</summary>
		SByte DepartmentDiscount { get; set; }

		/// <summary>公司折扣</summary>
		SByte CompanyDiscount { get; set; }

		/// <summary>修改时间</summary>
		DateTime ModifiedOn { get; set; }

		/// <summary>修改用户ID</summary>
		Int32 ModifiedUserID { get; set; }

		/// <summary>修改用户</summary>
		String ModifiedBy { get; set; }

		/// <summary>创建时间</summary>
		DateTime CreateOn { get; set; }

		/// <summary>创建用户ID</summary>
		Int32 CreateUserID { get; set; }

		/// <summary>创建用户</summary>
		String CreateBy { get; set; }

		#endregion 属性

		#region 获取/设置 字段值

		/// <summary>获取/设置 字段值。</summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		Object this[String name] { get; set; }

		#endregion 获取/设置 字段值
	}
}